package com.lanmaoly.web.server.entity;

import lombok.Data;

import java.io.Serializable;

/**
 * 用于向页面传递信息的类
 *
 * @author jt
 */
@Data
public class Result implements Serializable {

    private boolean success;
    private boolean flag;
    private String message;

    public Result(boolean success, String message) {
        super();
        this.success = success;
        this.flag = success;
        this.message = message;
    }

    public static Result success() {
        return new Result(true, "操作成功");
    }

    public static Result success(String message) {
        return new Result(true, message);
    }

    public static Result fail() {
        return new Result(false, "操作失败");
    }

    public static Result fail(String message) {
        return new Result(false, message);
    }
}
